const router = require('koa-router')()
const myGoodsRate = require('../api/myGoodsRate')
router.prefix('/myGoodsRate')
// #region
/**
 * @swagger
 * /myGoodsRate/getList 获取评论列表:
 *   get:
 *     description: 获取评论列表
 *     tags: [商品评论列表]
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: page
 *         description: 页码
 *         in: formData
 *         required: false
 *         type: number
 *       - name: size
 *         description: 页数
 *         in: formData
 *         required: true
 *         type: number
 *       - name: goodsId
 *         description: 传商品id筛选查询,不传则查询全部
 *         in: formData
 *         required: false
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.get('/getList', myGoodsRate.getList)
// #region
/**
 * @swagger
 * /myGoodsRate/replyComments 回复用户评论:
 *   post:
 *     description: 回复用户评论
 *     tags: [商品评论列表]
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: parentId
 *         description: 要回复的评论id
 *         in: formData
 *         required: false
 *         type: number
 *       - name: type
 *         description: 评论类型
 *         in: formData
 *         required: true
 *         type: string
 *       - name: adminId
 *         description: 商家回复传自己adminId，用户回复转userId
 *         in: formData
 *         required: false
 *         type: number
 *       - name: goodsId
 *         description: 商品id
 *         in: formData
 *         required: false
 *         type: number
 *       - name: description
 *         description: 内容
 *         in: formData
 *         required: false
 *         type: string
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.post('/replyComments', myGoodsRate.replyComments)
module.exports = router
